import 'package:flutter/material.dart';
import 'package:flutter_study/utils/Utils.dart';

class AnimatedContainerStudyPage extends StatefulWidget {
  const AnimatedContainerStudyPage({Key? key}) : super(key: key);

  @override
  _AnimatedContainerStudyPageState createState() =>
      _AnimatedContainerStudyPageState();



}

class _AnimatedContainerStudyPageState
    extends State<AnimatedContainerStudyPage> {
  bool isHeight = true;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("AnimatedContainer"),
        actions: [
          InkWell(
            child: Container(
              alignment: Alignment.center,
              child: Text("修改高度"),
              color: Colors.pink,
            ),
            onTap: () {
              setState(() {
                isHeight = !isHeight;
              });
              loge("$isHeight");
            },
          )
        ],
      ),
      body: Column(
        children: [
          AnimatedContainer(
            duration: Duration(seconds: 3),
            child: Text("==========="),
            color: Colors.pink,
            height: isHeight ? 50 : 100,
          ),
          Container(
            width: 100,
            height: 100,
            color: Colors.blue,
            child: AnimatedOpacity(
              opacity: isHeight ? 1 : 0,
              duration: Duration(seconds: 3),
              child: FlutterLogo(),
            ),
          ),
        ],
      ),
    );
  }
}



